﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        String lang = "en";

        private void btNewForm_Click(object sender, EventArgs e)
        {
            Form f2 = new Form2();
            f2.Show();
        }

        private void btChangeIcon_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.ICON1;
        }

        private void btResetIcon_Click(object sender, EventArgs e)
        {
            this.Icon = default(Icon);
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new System.Globalization.CultureInfo(lang));
            }

        }

        private void btClass1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            lbClass1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void btLanguage_Click(object sender, EventArgs e)
        {
            if (lang == "en")
                lang = "fr";
            else 
                lang = "en";
            ChangeLanguage(lang);
        }
    }
}